1. Field of the Invention
The present invention relates to a position detector with which the position of a movable part within a plane can be determined using magnetoresistive elements that can detect the direction and the intensity of a magnetic field, and a magnet.
2. Description of the Related Art
Japanese Unexamined Patent Application Publication Nos. 2005-331401, 2005-69744, and 2004-69695 disclose position detectors including a magnet and a detector configured to detect a magnetic field generated from the magnet.
In the position detectors disclosed in the above patent documents, an element that can detect magnetic field intensity, such as a Hall element, is provided in the detector. The position at which the magnet and the detector face each other is determined by detecting with the detector the intensity of a magnetic field component in a direction orthogonal to a surface of the magnet among magnetic field components generated from the surface of the magnet.
However, in the position detectors disclosed in the above patent documents, the detector includes an element, e.g., a Hall element, which can detect only the intensity of a magnetic field perpendicular to the surface of the magnet. Accordingly, an area where the position can be identified with the detector is limited. For example, in a position detector in which a top surface of a magnet is magnetized to the N-pole, the back surface thereof is magnetized to the S-pole, and a detector faces the top surface, the change in the intensity of a magnetic field component perpendicular to the top surface when the detector moves away from the center of the top surface of the magnet to one side is the same as that when the detector moves away from the center of the magnet to the other side. Therefore, in the case where the detector moves through the center, even when the intensity of the magnetic field is detected with the detector, the detector cannot distinguish whether the position of the detector is located in one area or the other area with respect to the center.
Accordingly, the area in which a position can be detected with the detector is very narrow. In order to accurately detect the position of a detector located on X-Y coordinates over a wide area, it is necessary to increase the size of a magnet. Furthermore, when a Hall element is used as the detector, a circuit constituting the detector is also complex.
Japanese Unexamined Patent Application Publication No. 2006-276983 discloses a magnetic sensor which detects a magnetic field generated from a circular magnet when the magnet moves. This magnetic sensor includes four giant magnetoresistive elements. Among the giant magnetoresistive elements, two giant magnetoresistive elements detect an X-direction component of a magnetic flux generated from the magnet, and two other giant magnetoresistive elements detect a Y-direction component of the magnetic flux generated from the magnet. For example, the difference in the change in the resistance of the two giant magnetoresistive elements that detect the X-direction component of the magnetic flux is determined, and the difference in the change in the resistance of the two other giant magnetoresistive elements that detect the Y-direction component of the magnetic flux is determined. Thereby, the position of the magnet is recognized.
However, each of the giant magnetoresistive elements has a structure in which magnetic fluxes in opposite directions, namely, in the positive direction and in the negative direction cannot be distinguished from each other. Accordingly, it is difficult to accurately know the movement position of the magnet.
In addition, for example, when the two giant magnetoresistive elements that detect the X-direction component of a magnetic flux move from the center of the magnet to a position away in the Y direction, not only the X-direction component of the magnetic field but also the Y-direction component of the magnetic field acts on a free magnetic layer of the giant magnetoresistive elements. Consequently, the magnetization of the free magnetic layer becomes unstable, and thus it is difficult to accurately know a change in the resistance corresponding to a movement position of the magnet in the X direction.